package com.youxuit.youxu.kecheng.threadLocal.usage1;

import java.text.SimpleDateFormat;

/**
 * 日期转换工具类
 */
public class DateFormatUsage00 {
    public static void main(String[] args) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                String date = new DateFormatUsage00().formatDate(1);
                System.out.println(date);
            }
        }).start();
        new Thread(new Runnable() {
            @Override
            public void run() {
                String date = new DateFormatUsage00().formatDate(2);
                System.out.println(date) ;
            }
        }).start();
    }

    public String formatDate(long times) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd mm:hh:ss");
        return dateFormat.format(times * 1000);
    }
}
